<%-- 
    Document   : viewProduct
    Created on : Nov 18, 2012, 5:46:00 PM
    Author     : tuan
--%>

<%@page import="java.util.Iterator"%>
<%@page import="data.ProductDAL"%>
<%@page import="data.Order"%>
<%@page import="java.util.ArrayList"%>
<%@page import="java.util.Collection"%>
<%@page import="data.ProductEntity"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
        <link href="../css/modern.css" rel="stylesheet">
        <link REL=StyleSheet HREF="../style/style.css" TYPE="text/css" MEDIA=screen> 
        <link href="../css/modern-responsive.css" rel="stylesheet">
        <!-- <link href="css/theme-dark.css" rel="stylesheet"> -->
        <SCRIPT language=javascript src="css/producttooltip.js" type=text/javascript></SCRIPT>

    </head>
    <body>
        <%
            String CategoryID = request.getParameter("CategoryID");
            String productID = request.getParameter("productID");
           
            if (session.getAttribute("orders") == null) {
                Collection<Order> orders = new ArrayList<Order>();
                session.setAttribute("orders", orders);
            }
            try {
                Collection<ProductEntity> list = ProductDAL.listAll();
                if (!list.isEmpty()) {
                    Iterator<ProductEntity> iter = list.iterator();
                    while (iter.hasNext()) {
                        ProductEntity entity = iter.next();
                    }
                } else {
                    out.println("We haven't had any product yet!");
                }
            } catch (Exception e) {
                out.println("Error: " + e.getMessage());
            }
        %>
        <div class="navigation-bar">
            <div class="navigation-bar-inner">
                <span class="menu-pull"></span>
                <div class="brand">
                    <a href="/"><span class="metro-ui-logo place-left"></span></a>
                    <a href="/"><span class="name">Converse Shoes Shop <sup class="fg-color-yellow tertiary-info-secondary-text">TM</sup></span></a>
                </div>
                <ul>
                    <li><a href="/">Home</a></li>
                    <li>
                        <a href="#">View Cart</a>
                    </li>
                    <li>
                        <a href="#">Check out</a>

                    </li>
                    <li>
                        <a href="#">Exit</a>
                    </li>
                </ul>
            </div>
        </div>
        <div><TABLE border="1">
                <tr>
                    <td></td>
                </tr>
                <tr>
                    <td rowspan="2" style="width: 430px">
                        <h1>View All Product
                        </h1>
                    <td colspan="3">
                        <input type ='submit' value='buttonSearchByName'>
                        <input type="text" id="name" name="Search" style="width:500px;height: 33px">
                    </td>
                </tr>
                <tr>
                    <td colspan="3">
                        <input type ='submit' value='buttonSearchByName'>
                        <input type="text" id="" name="Search" style="width:500px;height: 33px">
                    </td>
                </tr>
                <tr>
                    <td></td>
                </tr>
            </TABLE>

        </div>
        <div class="page snapped" style="width: 430px">
            <span class="span1">
                <jsp:include page="../viewProduct/viewProductLeft.jsp"/>
            </span>
        </div>
        <div class="page fill">
            <span class="span9">
                <table style="width: 900px;height: 900px">
                    <tr>
                        <td>
                            <jsp:include page="../viewProduct/viewProductBody.jsp">
                                <jsp:param name="CategoryID" value="<%=CategoryID%>" />
                                <jsp:param name="productID" value="<%=productID%>" />
                            </jsp:include>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <img src="../images/shopping_cart_small.png" >
                            <div style="background-image: url(../images/shopping_cart_small.png)"></div>
                        </td>
                    </tr>
                </table>
            </span>
        </div>

        <table>
            <tr>
                <td>
                    <div class="">
                        <jsp:include page="../viewProduct/viewProductFooter.jsp"/> 
                    </div>
                </td>
            </tr>
        </table>
    </body>
</html>
